package Views;

public class MainView extends javax.swing.JFrame
{
	public MainView()
	{
		initComponents();
		this.setResizable(true);
		this.setSize(680, 80);
		this.setResizable(false);
	}

	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPane = new SearchableTabbedPane();
        usernameL = new javax.swing.JLabel();
        usernameTF = new javax.swing.JTextField();
        passwordL = new javax.swing.JLabel();
        passwordTF = new javax.swing.JPasswordField();
        loginB = new javax.swing.JButton();
        logoutB = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Total Security");
        setLocationByPlatform(true);
        setName("Form"); // NOI18N
        setResizable(false);

        mainPane.setName("mainPane"); // NOI18N

        usernameL.setText("Login:");
        usernameL.setName("usernameL"); // NOI18N

        usernameTF.setName("usernameTF"); // NOI18N

        passwordL.setText("Password:");
        passwordL.setName("passwordL"); // NOI18N

        passwordTF.setName("passwordTF"); // NOI18N

        loginB.setText("Log ind");
        loginB.setName("loginB"); // NOI18N
        loginB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loginBActionPerformed(evt);
            }
        });

        logoutB.setText("Log ud");
        logoutB.setName("logoutB"); // NOI18N
        logoutB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutBActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(mainPane, javax.swing.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(usernameL)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(usernameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(passwordL)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(passwordTF, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(loginB)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(logoutB)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usernameL)
                    .addComponent(usernameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(passwordL)
                    .addComponent(passwordTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(loginB)
                    .addComponent(logoutB))
                .addGap(18, 18, 18)
                .addComponent(mainPane, javax.swing.GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void loginBActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_loginBActionPerformed
	{//GEN-HEADEREND:event_loginBActionPerformed
		this.setResizable(true);
		this.setSize(680, 560);
		this.setResizable(false);
		
		usernameTF.setEnabled(false);
		passwordTF.setEnabled(false);
		loginB.setEnabled(false);
		logoutB.setEnabled(true);
	}//GEN-LAST:event_loginBActionPerformed

	private void logoutBActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_logoutBActionPerformed
	{//GEN-HEADEREND:event_logoutBActionPerformed
		this.setResizable(true);
		this.setSize(680, 80);
		this.setResizable(false);
		usernameTF.setEnabled(true);
		passwordTF.setEnabled(true);
		loginB.setEnabled(true);
		logoutB.setEnabled(false);
	}//GEN-LAST:event_logoutBActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton loginB;
    private javax.swing.JButton logoutB;
    private javax.swing.JTabbedPane mainPane;
    private javax.swing.JLabel passwordL;
    private javax.swing.JPasswordField passwordTF;
    private javax.swing.JLabel usernameL;
    private javax.swing.JTextField usernameTF;
    // End of variables declaration//GEN-END:variables
}